﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Sprites
{
	public class FireFlower: Sprite
	{
		//private int width = 4;
		int height = 24;

		private LevelScene world;
		public int facing;

		public bool avoidCliffs = false;
		private int life;

		public FireFlower(LevelScene world, int x, int y)
		{
			sheet = Art.items;

			this.x = x;
			this.y = y;
			this.world = world;
			xPicO = 8;
			yPicO = 15;

			xPic = 1;
			yPic = 0;
			height = 12;
			facing = 1;
			wPic = hPic = 16;
			life = 0;
		}

		public override void collideCheck()
		{
			double xMarioD = world.mario.x - x;
			double yMarioD = world.mario.y - y;
			//double w = 16;
			if (xMarioD > -16 && xMarioD < 16)
			{
				if (yMarioD > -height && yMarioD < world.mario.height)
				{
					world.mario.getFlower();
					spriteContext.removeSprite(this);
				}
			}
		}

		public override void move()
		{
			if (life < 9)
			{
				layer = 0;
				y--;
				life++;
				return;
			}
		}
	}
}